import request from '@/config/axios'

export interface ProductionOutingVO {
  id: number
  orderNumber: string
  dictOrderType: number
  customerCode: string
  customerName: string
  productNumber: string
  productName: string
  productStandard: string
  productSize: string
  partNumber: string
  partName: string
  partSpecification: string
  proportionExpenses: string
  customerAddress: string
  packingAddress: string
  requirements: string
  orderQuantity: number
  outingQuantity: number
  dictUnit: number
  dictIncomingType: number
  vehicleModel: string
  trackingNumber: string
  sendNumber: string
  dictDeliveryType: number
  licencePlate: string
  driverName: string
  driverPhone: string
  inventoryNumber: string
  warehouseCode: string
  warehouseName: string
}

// 查询生产管理--产品管理--产品出库列表
export const getProductionOutingPage = async (params) => {
  return await request.get({ url: `/produce/production-outing/page`, params })
}

// 查询生产管理--产品管理--产品出库详情
export const getProductionOuting = async (id) => {
  return await request.get({ url: `/produce/production-outing/view?id=` + id })
}
// 查询生产管理--产品管理--产品出库物流信息
export const getTrackingNumber = async (trackingNumber) => {
  return await request.get({ url: `/produce/production-shipments/get-by-tracking-number?trackingNumber=` + trackingNumber })
}

// 新增生产管理--产品管理--产品出库
export const createProductionOuting = async (data: ProductionOutingVO) => {
  return await request.post({ url: `/produce/production-outing/create`, data })
}

// 修改生产管理--产品管理--产品出库
export const updateProductionOuting = async (data: ProductionOutingVO) => {
  return await request.put({ url: `/produce/production-outing/update`, data })
}

// 删除生产管理--产品管理--产品出库
export const deleteProductionOuting = async (id: number) => {
  return await request.delete({ url: `/produce/production-outing/delete?id=` + id })
}

// 导出生产管理--产品管理--产品出库 Excel
export const exportProductionOuting = async (params) => {
  return await request.download({ url: `/produce/production-outing/export-excel`, params })
}
